﻿CREATE TABLE [dbo].[SecurityAuthority]
(
	[Id] [dbo].[Id] NOT NULL  IDENTITY(1000000000, 1), 
    [Name] [dbo].[Name] NOT NULL, 
    [Description] [dbo].[Description] NOT NULL , 

	[SecurityAuthorityType] [dbo].[EnumerationValue] NOT NULL, 
	[Protocol] dbo.Name NULL,
	ServerName dbo.Name NULL,
	Domain dbo.Name NOT NULL,

    [CreateId] [dbo].[Name] NOT NULL , 
    [CreateDateTime] [dbo].[CreateModifiedDateTime] NOT NULL , 
    [ModifiedId] [dbo].[Name] NOT NULL , 
    [ModifiedDateTime] [dbo].[CreateModifiedDateTime] NOT NULL , 

    CONSTRAINT [PK_SecurityAuthority] PRIMARY KEY (Id), 
    CONSTRAINT [AK_SecurityAuthority_Name] UNIQUE (Name),
	CONSTRAINT [AK_SecurityAuthority_NameType] UNIQUE (Name, SecurityAuthorityType)

)
